1. Technical Field
The present invention is directed to an apparatus and method for implementing switch instructions in an IA64 architecture.
2. Description of Related Art
Dense switch instructions, such as tableswitch in Java bytecode, provide for multi-way branching based on an input integer and a range of integer values. Known systems implement such switching instructions in one of two ways. First, multiple compare/branch pairs may be utilized followed by a branch to a default address. Alternatively, a check to see if an input index value falls within a specified range may be made with a target address being selected from an array of such addresses if the index does fall within the range. If the index does not fall within the range, a default address is provided. The address is then loaded in a branch register and an execution branch to that address is performed.
Both approaches set forth above require multiple comparisons which take up processing cycles that may otherwise be used for other useful work. Thus, it would be advantageous to have an apparatus and method for implementing a switch instruction which reduces the number of comparisons required to perform the switch instruction. It would further be beneficial to have an apparatus and method to perform such switching instructions in an IA64 architecture based data processing device.